<!-- /* Description for file.
 * 相关简历页面
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/resumes
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0717
 * @lastmodified  张海杰2011年0718
 */
 -->

<?php
echo $html->css ( 'style' );
echo $html->css ( 'tab' );
echo $javascript->link ( 'jquery' );
?>

<script>
$(function() { 
	$("#checkedAll").click(function() { 
	if ($(this).attr("checked") == true) { // 全选 
	$("input[name='checkbox_name']").each(function() { 
	$(this).attr("checked", true); 
	}); 
	} else { // 取消全选 
	$("input[name='checkbox_name']").each(function() { 
		
	$(this).attr("checked", false); 
	}); 
	} 
	}); 
	}); 

function getDelStr() {
	var delArr = $("input[name='checkbox_name']:checkbox:checked");
	if(delArr.length==0)
	{
		alert("请选择项!");
		return;
	}
	var str = "";
	for(var i=0;i<delArr.length;i++) {
		var del = delArr[i].value;
		str += del;
		str += "/";
	}
	$("#delStr").val(str);
}
$(document).ready(function(){
	//强制相关
	$("#setRelationResume").click(function(){
		//getDelStr();
		//alert($("#ResumesResumeid").val());
		var  relationResumeIdGroup = "";
		var str = $("#ResumesRelationResumeIdGroup").val();
		var flag = false; 
		var del="";
		$("input[name='checkbox_name']:checkbox:checked").each(function(){
			    del=$(this).val();
				//alert(del);
				var ResumesRelationResumeIdList = str.split('/');
				for(i=0; i<ResumesRelationResumeIdList.length; i++){
					if(ResumesRelationResumeIdList[i] == del)
					{
						flag = true;
					}
				}
				if(flag !=true )
				{
					relationResumeIdGroup += del + '/';
					flag = false;
				}
			});
		relationResumeIdGroup += str;
		$.post(
				'<?php echo ROOT_WEB_PATH; ?>/resumes/setRelationResume/'+$("#ResumesResumeid").val(),
				{
					data: {relationResumeIdGroup:relationResumeIdGroup
				   }
				},
				function()
				{
					window.location.reload();
				});
			});
	//解除相关
	$("#unSetRelationResume").click(function(){
		//getDelStr();
		var  relationResumeIdGroup = "";
		var str = $("#ResumesRelationResumeIdGroup").val();
		var flag = false; 
		var del="";
		$("input[name='checkbox_name']:checkbox:checked").each(function(){
			    del=$(this).val();
			    var ResumesRelationResumeIdList = str.split('/');
				for(i=0; i<ResumesRelationResumeIdList.length; i++){
					if(ResumesRelationResumeIdList[i] == del)
					{
						flag = true;
					}
				}
				if(flag ==true )
				{
					str = str.replace(del + '/',"");
					flag1 = false;
					//alert(str);
				}
			});
		$.post(
				'<?php echo ROOT_WEB_PATH; ?>/resumes/unSetRelationResume/'+$("#ResumesResumeid").val(),
				{
					data: {relationResumeIdGroup:str
					}
				},
				function()
				{
					//alert(relationResumeIdGroup);
					window.location.reload();
				});
			});
	$("#fdeleteSome").click(function(){	
		getDelStr();
		$.post(
				'<?php echo ROOT_WEB_PATH; ?>/resumes/fdeleteSome/',
				{
					ids:$("#delStr").val()
				},
				function()
				{
					window.location.reload();
				});
		// $("#ResumesFdeleteSomeForm").submit();
	});
});

</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Resumesmanagements');//一级目录
										   echo '>';echo __('Resumesallinfo search');//一级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Customer Managements Detail',true));//简历详细信息当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<div class="tabflex">
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
			<tr>
				<td height="20"><a href="<?php echo ROOT_WEB_PATH; ?>/resumes/resumedetail/<?php echo $resume['Resume']['id'];?>">具体简历</a></td>
				<td ><a href="<?php echo ROOT_WEB_PATH; ?>/resumes/mutualityresume/<?php echo $resume['Resume']['id'];?>" style="color:Red;">相关简历</a></td>
				<td ><a href="<?php echo ROOT_WEB_PATH; ?>/resumespostils/init/<?php echo $resume['Resume']['id'];?>">简历批注</a></td>
				<td ><a href="<?php echo ROOT_WEB_PATH; ?>/resumes/resumecommend/<?php echo $resume['Resume']['id'];?>">推荐面试</a></td>
				<td ><a href="<?php echo ROOT_WEB_PATH; ?>/resumes/allinfosuitposition/<?php echo $resume['Resume']['id'];?>">适合职位</a></TD>
				<td ><a href="<?php echo ROOT_WEB_PATH; ?>/resumes/resumefiles/<?php echo $resume['Resume']['id'];?>">简历附件</a></td>
				<td ><a href="<?php echo ROOT_WEB_PATH; ?>/resumes/resumereports/<?php echo $resume['Resume']['id'];?>">简历报告</a></td>
				<td ><a href="<?php echo ROOT_WEB_PATH; ?>/resumes/viewresumecontext/<?php echo $resume['Resume']['id'];?>">查看全文</a></TD>
				<td ></td>
			</tr>
</table>

<fieldset><legend><?php __('Resumes mutualityresume');//相关简历?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td><?php __('Resumes script');// 简历原件?>：
		<?php 	if($resume['Resume']['resumefilepath']!=null&&$resume['Resume']['resumefilepath']!="")
				{
					$dir="files-resumefiles";
					echo $html->link($resume['Resume']['resumefilename'],
					'/resumes/down/'.$dir.'/'.$resume['Resume']['resumefilepath'],
					array('class'=>'view'));
				}
		?>
		</td> 
	</tr>
	<tr>
		<td width="50"></td>
		<td><?php echo $resume['Resume']['name']?>&nbsp;&nbsp;的<?php __('Resumes mutualityresume');//相关简历?>
		(<?php __('Resumespostil resumeid');//简历ID?>：<?php echo $resume['Resume']['id']?>)&nbsp;&nbsp;<?php echo $resume['Resume']['tel']?>
		</td> 
	</tr>
	<tr>
		<td width="50"></td>
		<td>
		<table width="40%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td width="100px">
				<a id="setRelationResume" style="cursor:pointer;"><?php echo $html->image('connect.gif', 
		 							array('title'=>'强制相关','border'=>'0','id'=>'setRelationResume')); ?>&nbsp;强制相关</a>			
				</td>
				<td width="100px">
				<a id="fdeleteSome" style="cursor:pointer;"><?php echo $html->image('delete.gif', 
									array('alt' =>  __('Delete', true),'border'=>'0','id'=>'fdeleteSome'));?>&nbsp;删除简历</a>
				</td>
				<td width="100px" style="cursor:pointer;">
				<a id="unSetRelationResume"><?php echo $html->image('disconnect.gif', 
		 							array('title'=>'解除相关','border'=>'0','id'=>'unSetRelationResume')); ?>&nbsp;解除相关</a>					
				</td>
				<td></td>
			</tr>
		</table>
		</td>
	</tr>

</table>
</fieldset>
<!--假删除form开始 -->
<?php echo $form->create('Resumes',array('action'=>'fdeleteSome','type'=> 'post'));?>
<?php echo $form->hidden('delStr',array('name'=>'ids','id'=>'delStr'));?>
<?php echo $form->hidden('resumeid',array('value'=>$resume['Resume']['id'])); ?>
<?php echo $form->hidden('relationResumeIdGroup',array('value'=>$resume['Resume']['relationResumeIdGroup']));//简历相关组ID<?>
<div id="nav1" style="width: 97%">
<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th width="70px"><?php echo $form->checkbox('',array('id'=>'checkedAll'));?></th>
		<th width="80px"><?php echo __('NO');//序号?></th>
		<th width="140px"><?php echo __('resumesname');//姓名?></th>
		<th width="140px"><?php echo __('resumessex');//性别?></th>
		<th><?php echo __('resumesemail');//电子邮件?></th>
	</tr>
	<!-- Here's where we loop through our $Notes array, printing out post info --> 
	<?php 
	foreach ($relationresumes as $datas): //相关简历
	
	?>
		<tr class=normal onmouseover='this.className= "over " '
		onmouseup='this.className= "over " '
		onmouseout='this.className= "normal " '>
		<td><!-- 批量删除选择 -->				
			<?php echo $form->checkbox($datas['Resume']['id'], array('value' => $datas['Resume']['id'],'name'=>'checkbox_name'));?>
			</td>
		<td><?php echo $html->link($datas['Resume']['id'], array('controller' => 'resumes','action' => 'resumedetail', $datas['Resume']['id']),array('target'=>'_blank')); ?></td>
		<td><?php echo $datas['Resume']['name']; ?></td>
		<td><?php echo $datas['Resume']['sex']; ?></td>
		<td><?php echo $datas['Resume']['email']; ?></td>
		
	</tr> 
	<?php endforeach; ?>  
	</table>
</div>
<?php echo $form->end();?>
<!--假删除form结束 -->
<!--已关联简历-->
<div id="nav1" style="width: 97%">
<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th width="70px"><span style="font-weight:bold">已相关简历</span></th>
		<th width="80px"><?php echo __('NO');//序号?></th>
		<th width="140px"><?php echo __('resumesname');//姓名?></th>
		<th width="140px"><?php echo __('resumessex');//性别?></th>
		<th><?php echo __('resumesemail');//电子邮件?></th>
	</tr>
	<!-- Here's where we loop through our $Notes array, printing out post info --> 
	<?php 
	foreach ($hasrelationresumes as $datas): //已相关简历
	
	?>
		<tr class=normal onmouseover='this.className= "over " '
		onmouseup='this.className= "over " '
		onmouseout='this.className= "normal " '>
		<td></td>
		<td><?php echo $html->link($datas['Resume']['id'], array('controller' => 'resumes', 'action' => 'resumedetail', $datas['Resume']['id']),array('target'=>'_blank')); ?></td>
		<td><?php echo $datas['Resume']['name']; ?></td>
		<td><?php echo $datas['Resume']['sex']; ?></td>
		<td><?php echo $datas['Resume']['email']; ?></td>
	</tr> 
	<?php endforeach; ?>  
	</table>
</div>

<!--已关联简历-->
</div>







